package com.second.system.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.second.common.pojo.Permission;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by wang1 on 2023/5/22 18:47
 */
public interface PermissionDao extends BaseMapper<Permission> {
    @Select(value = "select p.* from acl_permission p join acl_role_permission rp on p.id=rp.permission_id\n" +
            "join acl_user_role ur on ur.role_id=rp.role_id where ur.user_id=#{userId} and type=1")
    List<Permission> selectByUserId(String userId);
}
